<html>
<head><meta charset="utf-8"><title>configuration for auto-targets · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/configuration.20for.20auto-targets.html">configuration for auto-targets</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="226596083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/configuration%20for%20auto-targets/near/226596083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/configuration.20for.20auto-targets.html#226596083">(Feb 16 2021 at 23:53)</a>:</h4>
<p>question: is there a reason cargo doesn't let you configure auto-discovered targets (<a href="https://doc.rust-lang.org/cargo/reference/cargo-targets.html#target-auto-discovery">https://doc.rust-lang.org/cargo/reference/cargo-targets.html#target-auto-discovery</a>)? For example, if I want to use a different dir than src/ or tests/, or I want to have 2 test suites with different names? currently for integration tests this would require creating a [[test]] for every file in the tests2/ dir, unless im mistaken?</p>



<a name="226597456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/configuration%20for%20auto-targets/near/226597456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/configuration.20for.20auto-targets.html#226597456">(Feb 17 2021 at 00:10)</a>:</h4>
<p>If you're doing the default thing then there's no configuration. If you're doing something complicated you need to Define it exactly. Both extremes make sense. Could we find a better unambiguous Syntax for things in the middle, probably.</p>



<a name="226598129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/configuration%20for%20auto-targets/near/226598129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/configuration.20for.20auto-targets.html#226598129">(Feb 17 2021 at 00:20)</a>:</h4>
<p>Yeah, implementation wise it seems very easy to allow people to rename the string <code>tests/</code> that cargo uses, or add an additional dirs that it looks for tests in (well, target name clashes might make this more complex), and leave the no-configuration happy path alone and simple to reason about</p>
<p>if I was interested in this, would I start with a pr, or like...a cargo rfc?</p>



<a name="226599336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/configuration%20for%20auto-targets/near/226599336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/configuration.20for.20auto-targets.html#226599336">(Feb 17 2021 at 00:37)</a>:</h4>
<p>I'd start by waiting for some more of the Cargo Team to comment on whether this is a design we will accept.  If you want to get started, a clear description on internals or in an issue can't hurt.<br>
If you want a semi practical solution that you can use right now, you can use what we do in the Cargo repo. Have one test that imports a bunch of files from a subdirectory. Then ther is only one thing to configure in the Cargo.toml.</p>



<a name="226599514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/configuration%20for%20auto-targets/near/226599514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/configuration.20for.20auto-targets.html#226599514">(Feb 17 2021 at 00:39)</a>:</h4>
<p>And of course, thank you for being willing to contribute. That always means a lot!</p>



<a name="226599533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/configuration%20for%20auto-targets/near/226599533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/configuration.20for.20auto-targets.html#226599533">(Feb 17 2021 at 00:39)</a>:</h4>
<p>And of course, thank you for being willing to contribute. That always means a lot!</p>



<a name="226600187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/configuration%20for%20auto-targets/near/226600187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/configuration.20for.20auto-targets.html#226600187">(Feb 17 2021 at 00:48)</a>:</h4>
<p><span class="user-mention" data-user-id="120179">@Eh2406</span> thank you for the pointers! Ill see what people say, think and read some more and go from there!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>